package com.cms.recursoshumanos.main;


import com.cms.recursoshumanos.ui.SplashScreen;

import net.rim.device.api.system.EventLogger;
import net.rim.device.api.ui.UiApplication;

/**
 * This class extends the UiApplication class, providing a
 * graphical user interface.
 */
public class RecursosHumanosMain extends UiApplication
{
    /**
     * Entry point for application
     * @param args Command line arguments (not used)
     */ 
    /*public static void main(String[] args)
    {
        // Create a new instance of the application and make the currently
        // running thread the application's event dispatch thread.
        RecursosHumanosMain theApp = new RecursosHumanosMain();       
        theApp.enterEventDispatcher();
    }
    */

    /**
     * Creates a new MyApp object
     */
 
    
 
    	//	com.cms.moviltrack.mainEventLoggerID
    	public static long EventLoggerID = 0x8a6752198153ae95L;
    	
    	public static void main(String[] args) 
    	{ 
    		//try
    		//{
    			EventLogger.register(RecursosHumanosMain.EventLoggerID,	".RecursosHumanis", EventLogger.VIEWER_STRING);
    			EventLogger.logEvent(RecursosHumanosMain.EventLoggerID, 	"Registro exitoso".getBytes());
    			
    			// Perform initialization on device startup.
    			/*if (args.length == 1 && args[0].equals("startup")) 
    			{
    				GenericBackgroundApp daemon = new GenericBackgroundApp();
    				
    				// This daemon application will be responsible for
    				// listening for notifications and menu actions, it runs until
    				// the device shuts down or the app is uninstalled.
    				daemon.enterEventDispatcher();
    			}*/
    			
    			/*elseif (args.length == 1 && args[0].equals("desdefolder")) 
    			{*/
    				
    				// Create a GUI instance for displaying a DemoMessageScreen.
    				// This will occur when our app is invoked by the
    				// View Demo Message menu item.
    				AppPermissionsManager.setPermissions();
    				
    				RecursosHumanosMain main = new RecursosHumanosMain(true);			
    				main.enterEventDispatcher();
    				
    	
    			/*} 
    			else 
    			{
    				AppPermissionsManager.setPermissions();
    				
    				RecursosHumanosMain main = new RecursosHumanosMain(false);
    				main.enterEventDispatcher();
    			}*/
    		/*} 
    		catch (Exception e) 
    		{
    			Dialog.alert("Error en la aplicacion. Por favor comuniquese con su proveedor.");
    			System.exit(0);
    		}*/
    	} 
    	public RecursosHumanosMain(boolean externalEntryPoint) 
    	{
    		if (externalEntryPoint) {
    			
    				this.showGui();
    			
    		}
    	}
    	
    	private void showGui() 
    	{
    		UiApplication.getUiApplication().pushScreen(new SplashScreen());
    		enterEventDispatcher();
    	}
    	
    	public static void log(String texto) 
    	{
    		EventLogger.logEvent(EventLoggerID, texto.getBytes());
    	}
    	
    
    
    
}
